import request from '@/utils/request'

//获取用户购物车信息
export function getCart(id) {
    return request({
        url: 'api/cart/id=' + id,
        method: 'get'
    })
}

export function deleteShopping(id) {
    return request({
        url: 'api/cart/delete/id=' + id,
        method: 'delete'
    })
}


export function addCatr(data) {
    return request({
        url: 'api/cart/addCart',
        method: "post",
        data: data
    })
}


export function getShoppingId(userId, commodityId) {
    return request({
        url: `api/cart/getCart?userId=${userId}&commodityId=${commodityId}`,
        method: 'get'
    })
}


export function update(id) {
    return request({
        url: 'api/shopping/update/id=' + id,
        method: 'put'
    })
}
